from time import sleep

import uiautomator2 as u2
d=u2.connect_usb()
d.app_start("com.yishouapp.fumi")
d(textContains="主站").click()
d.xpath('//*[@text="我的"]').click()
d.swipe_ext("up")
# d.swipe(400,900,400,100,0.1)
sleep(1)
# d.swipe(1000,1800,200,1800)

d.drag(0.768, 0.789,0.255, 0.787,0.2)
d.drag(0.768, 0.789,0.255, 0.789,0.1)
sleep(5)
d.app_stop("com.yishouapp.fumi")
# # d.xpath('//*[@resource-id="com.yishouapp.fumi:id/fra_seting"]').click()
# # d.xpath('//*[@text="收货地址"]').click()
# # d.xpath('//*[@resource-id="com.yishouapp.fumi:id/text_right"]').click()
# #
# # d.xpath('//*[@resource-id="com.yishouapp.fumi:id/et_name"]').click()
# # d.send_keys('马可')
# #
# # d.xpath('//*[@resource-id="com.yishouapp.fumi:id/et_number"]').click()
# # # d.send_keys('13412341234')
# # d(focused=True).send_keys("12345667666")
#
# # d.xpath('//*[@resource-id="com.yishouapp.fumi:id/tv_home_search_tip"]').click()
# # d.xpath('//*[@resource-id="com.yishouapp.fumi:id/et_search"]').click()
# # d.set_fastinput_ime(True)         # 切换成FastInputIME输入法
# # d.send_keys("123")                # adb广播输入
# # d.set_fastinput_ime(False)
# # sleep(4)
# # d(textContains="消息").click()
# # # d.swipe_ext("up",0.5)
# #
# # xy="11,12"
# # xy=xy.split(",")
# # print(xy)
# # print(xy[0])
# # print(xy[1])
# from keywords.appkeys import App
# app=App()
# app.appstart('com.yishouapp.fumi')
# sleep(2)
#
# # app.click("aaa")
# #
# # app.close('com.yishouapp.fumi')
# # app.appstart("com.yishouapp.fumi")
# app.click("主站")
# app.sleep(2)
# # app.click('//*[@resource-id="com.yishouapp.fumi:id/tv_home_search_tip"]')
# # app.input('//*[@resource-id="com.yishouapp.fumi:id/et_search"]','衬衫')
# # app.click('//*[@resource-id="com.yishouapp.fumi:id/iv_search"]')
# app.click('//*[@text="我的"]')
# app.click('//*[@resource-id="com.yishouapp.fumi:id/fra_seting"]')
# app.click('//*[@text="收货地址"]')
# app.click('//*[@resource-id="com.yishouapp.fumi:id/text_right"]')
# app.input('//*[@resource-id="com.yishouapp.fumi:id/et_name"]',"马可")
# app.input('//*[@resource-id="com.yishouapp.fumi:id/et_number"]',"13412341234")
